package com.dy.lock.screen.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.dy.lock.screen.dao.ScoreDao;
import com.dy.lock.screen.pojo.ScoreInfo;
import com.dy.lock.screen.service.ScoreService;
import com.dy.lock.screen.vo.EverydayToday;

@Service("scoreService")
public class ScoreServiceImpl implements ScoreService {

	@Resource(name = "scoreDao")
	private ScoreDao scoreDao;

	@Override
	public List<ScoreInfo> queryIncomeBills(String customerId) {
		return this.scoreDao.queryIncomeBills(customerId);
	}

	@Override
	public List<ScoreInfo> queryPayBills(String customerId) {
		return this.scoreDao.queryPayBills(customerId);
	}

	@Override
	public List<EverydayToday> queryIncomeBillDetail(String customerId,
			String month) {
		Map<String, String> paraMap = new HashMap<String, String>();
		paraMap.put("customerId", customerId);
		paraMap.put("month", month);
		return this.scoreDao.queryIncomeBillDetail(paraMap);
	}

	@Override
	public List<EverydayToday> queryPayBillDetail(String customerId,
			String month) {
		Map<String, String> paraMap = new HashMap<String, String>();
		paraMap.put("customerId", customerId);
		paraMap.put("month", month);
		return this.scoreDao.queryPayBillDetail(paraMap);
	}

	@Override
	public ScoreInfo getExchangedScore(ScoreInfo scoreInfo) {
		return this.scoreDao.queryByPrimaryKey(scoreInfo);
	}

	@Override
	public ScoreInfo getTodayScore(ScoreInfo scoreInfo) {
		return this.scoreDao.queryByCustomerId(scoreInfo);
	}

	// @Override
	// public int customerSignIn(ScoreInfo scoreInfo) {
	// return this.scoreDao.update(scoreInfo);
	// }

	@Override
	public ScoreInfo queryByPrimaryKey(String costomerId) {
		return this.scoreDao.queryByPrimaryKey(costomerId);
	}

	@Override
	public int updateScore(ScoreInfo scoreInfo) {
		// TODO Auto-generated method stub
		return this.scoreDao.updateScore(scoreInfo);
	}

	@Override
	public int save(ScoreInfo scoreInfo) {
		// TODO Auto-generated method stub
		return this.scoreDao.insert(scoreInfo);
	}

}
